package com.itheima.tlias.service.impl;

import com.itheima.tlias.domain.Dept;
import com.itheima.tlias.mapper.DeptMapper;
import com.itheima.tlias.service.DeptService;
import com.itheima.tlias.vo.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author ghy
 * @version 1.0.1
 * @date 2024-01-28 09:44:07
 */
@Service
@Transactional
@Slf4j
public class DeptServiceImpl implements DeptService {

    @Autowired
    private DeptMapper deptMapper;

    @Transactional(readOnly = true)
    @Override
    public Result findAll() {
        log.info("DeptServiceImpl findAll");
        List<Dept> depts = deptMapper.findAll();
        return Result.success(depts);
    }
}
